package org.xlx.xlx_oa.warehouse.api;

import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.springframework.web.bind.annotation.*;
import org.xlx.xlx_oa.common.ResponseBean;
import org.xlx.xlx_oa.warehouse.domain.vo.WarehouseVo;

@ApiImplicitParams(value = {
        @ApiImplicitParam(name = "x-request-id", value = "${clientTraceId}",
                paramType = "header", dataType = "String", dataTypeClass = String.class),
        @ApiImplicitParam(name = "Authorization", value = "${BearerToken}",
                paramType = "header", dataType = "String", dataTypeClass = String.class, required = false)
})
@ApiResponses(value = {
        @ApiResponse(code = 400, message = "Bad Request"),
        @ApiResponse(code = 401, message = "Authentication Error"),
        @ApiResponse(code = 403, message = "Authorization Error"),
        @ApiResponse(code = 500, message = "Internal Server Error"),
        @ApiResponse(code = 503, message = "Service Unavailable")
})
public interface WarehouseApi {
    @PostMapping("/save")
    ResponseBean saveWarehouse(@RequestBody WarehouseVo warehouseVo);

    @GetMapping("/remove/{id}")
    ResponseBean removeWarehouse(@PathVariable(value = "id") Long id);

    @PostMapping("/list")
    ResponseBean getList(@RequestBody WarehouseVo warehouseVo);

    @PostMapping("/count")
    ResponseBean getCount(@RequestBody WarehouseVo warehouseVo);

    @PostMapping("/search")
    ResponseBean searchByTitle(@RequestParam(value = "title") String title);
}
